<div class="content1" href="">











    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <title>放款查询页面</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/base.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <link href="css/layer.css" rel="stylesheet">
    <link href="css/pagination.css" rel="stylesheet">
    <link href="css/bootstrap-datetimepicker.css" rel="stylesheet">
    <link href="css/dataTables.bootstrap.min.css" rel="stylesheet">
    <link href="css/jedate.css" rel="stylesheet">
    <style>
        #loanDetail{
            background-color: #fff;
            margin-bottom: 15px;
        }
        #loanDetail p{
            padding-left:0 ;
            padding-right: 0;
            margin: 6px 0 ;
        }
        #loanDetail .wd_60{
            display: inline-block;
            width: 102px;
            text-align: right;
            font-size: 12px;
            font-family: "微软雅黑";
        }
        #loanDetail .c13 .wd_60{
            float: left;
            margin-top: 5px;
        }
        #loanDetail .c13 input{
            float: left;
            font-size: 12px;
            font-family: "微软雅黑";
        }
        #loanDetail .col-lg-3 ,#loanDetail .c13{
            margin:5px 0;
            padding-left:5px;
            padding-right: 5px;
        }

        #loanDetail select option{
            font-size: 12px;
            font-family: "微软雅黑";
        }
        .search_btn {
            font-size: 12px;
            background-color: #09C;
            padding: 5px 16px;
            margin-top: 3px;
            margin-bottom: 5px;
        }
        .ta_r{
            text-align: right;
        }
        .mr_25{
            margin-right: 25px;
        }
        .cardSelect{
            border: 1px solid #ddd;
            height: 25px;
            width: 150px;
            font-size: 12px;
        }
    </style>

<div class="hui"><img src="images/ajax-loader.gif"></div>
        <div class="content">
            <!--面包屑导航start-->
            <ol class="breadcrumb">
                <li class="active">已放款列表查询</li>
            </ol>
            <div id="loanDetail" class="col-lg-12 col-md-12 col-sm-12">
                <div class="col-lg-3 col-md-3 col-sm-3" style="padding-left:0px "><span class="wd_60" style="text-align:left;width:70px">身份证号&nbsp;&nbsp;</span><input type="text" id="idNo"></div>
                <div class="col-lg-3 col-md-3 col-sm-3" style="padding-left:0px"><span class="wd_60" style="text-align:left;width:40px">姓名&nbsp;&nbsp;</span><input type="text" id="idName"></div>
                <div class="col-lg-3 col-md-3 col-sm-3" style="padding-left:0px"><span class="wd_60" style="margin-left: 0px;margin-top: 5px">资方放款日期(开始)&nbsp;&nbsp;</span><input type="text" id="applyDateStart1" value="2019-05-20" placeholder="请选择时间" readonly=""></div>
                <div class="col-lg-3 col-md-3 col-sm-3" style="padding-left:0px"><span class="wd_60" style="margin-left: 0px;margin-top: 5px">资方放款日期(结束)&nbsp;&nbsp;</span><input type="text" id="applyDateStart2" value="2019-05-20" placeholder="请选择时间" readonly=""></div>
                <div class="col-lg-3 col-md-3 col-sm-3" style="padding-left:0px"><span class="wd_60" style="text-align:left;width:60px">资方&nbsp;&nbsp;</span><select id="fundSource"><option value="">请选择</option><option value="1">北银</option><option value="14">91金融</option><option value="13">沃付分期</option><option value="22">医美</option><option value="30">苏宁</option><option value="100">mini循环贷</option><option value="3">海尔教育</option><option value="4">安信小贷</option><option value="5">百度</option><option value="7">海尔租房</option><option value="8">华融</option><option value="11">贷鱼教育</option><option value="15">湖北消费金融</option><option value="16">91旺财</option><option value="18">晋商租房</option><option value="17">晋商教育</option></select></div>
                <div class="col-lg-3 col-md-3 col-sm-3" style="padding-left:0px"><span class="wd_60" style="text-align:left;width:40px">商户&nbsp;&nbsp;</span><input type="text" id="bcName"></div>
                <div class="col-lg-3 col-md-3 col-sm-3" style="padding-left:0px"><span class="wd_60" style="margin-left: 10px;margin-top: 5px">信审日期(开始)&nbsp;&nbsp;</span><input type="text" id="applyDateStart3" value="2019-05-20 00:00:00" placeholder="请选择时间" readonly=""></div>
                <div class="col-lg-3 col-md-3 col-sm-3" style="padding-left:0px"><span class="wd_60" style="margin-left: 10px;margin-top: 5px">信审日期(结束)&nbsp;&nbsp;</span><input type="text" id="applyDateStart4" value="2019-05-20 23:59:59" placeholder="请选择时间" readonly=""></div>
                <div style="margin-left: 5px">
                    贷款状态&nbsp;&nbsp;
                    <input type="checkbox" style="width: 15px; height: 15px; margin-left: 5px" name="rebateType" value="9000" checked="" class="ckb">订单完结&nbsp;&nbsp;
                    <input type="checkbox" name="rebateType" style="width: 15px; height: 15px; margin-left: 5px" value="7000" checked="" class="ckb">已放款&nbsp;&nbsp;
                    <input type="checkbox" name="rebateType" style="width: 15px; height: 15px; margin-left: 5px" value="8000" checked="" class="ckb">提前还款&nbsp;&nbsp;
                    <input type="checkbox" name="rebateType" style="width: 15px; height: 15px; margin-left: 5px" value="9500" checked="" class="ckb">退货&nbsp;&nbsp;
                </div>
                <div class="col-lg-3 col-md-3 col-sm-3">

                </div>
                <div class="col-lg-3 col-md-3 col-sm-3 ta_r">
                    <button class="btn btn-primary btn-sm search_btn" type="button" id="btn-search">查询</button>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <button class="btn btn-primary btn-sm search_btn mr_25" type="button" id="btn-export" onclick="exportResult();">导出</button>
                </div>
                <div class="clear"></div>
            </div>
            <div class="table-responsive">
                <div id="lendingList_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer"><div class="top"><div class="clear"></div></div><div id="lendingList_processing" class="dataTables_processing panel panel-default" style="display: none;">处理中...</div><table id="lendingList" style="width: 100%;" class="table table-bordered table-striped table-condensed table-hover bg_wt dataTable no-footer" role="grid" aria-describedby="lendingList_info">
                    <thead style="border-bottom: 0;background-color: #fff;">
                    <tr role="row"><th class="text-center fs_13 sorting_disabled hidden" rowspan="1" colspan="1" style="width: 0px;">1</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 18px;">资金方</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 120px;">&nbsp;商&nbsp;&nbsp;户&nbsp;</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 27px;">客户姓名</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 112px;">身份证号码</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 63px;">申&nbsp;请&nbsp;时&nbsp;间</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 63px;">审核通过时间</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 27px;">放款日期</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 25px;">申请金额</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 25px;">申请期限</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 25px;">贴息方式</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 17px;">宽限期</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 31px;">期供款</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 38px;">资方放款金额</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 39px;">贷鱼放款金额</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 23px;">贷款状态</th><th class="text-center sorting_disabled" rowspan="1" colspan="1" style="width: 91px;">操作</th></tr>
                    </thead>
                <tbody><tr role="row" class="odd"><td class=" hidden">6535879419711456257</td><td>晋商教育</td><td>广东明世在线教育科技有限公司</td><td>徐灿灿</td><td>411524199909282748</td><td>2019-05-20 12:39:25</td><td>2019-05-20 12:48:44</td><td>2019-05-20</td><td>6215</td><td>12</td><td>商户贴息</td><td>0</td><td>517.92</td><td>6215</td><td>5773.73</td><td>已放款</td><td><button type="button" data-id="6535879419711456257" class="btn btn-primary btn-sm mt_3" style="margin-bottom: 5px;padding:5px 16px;" name="public-deduct">提前结清</button><button type="button" data-id="6535879419711456257" data-source="17" data-cust-id="6535871355449105409" data-cust-name="徐灿灿" class="btn btn-primary btn-sm mt_3" name="modify_card">变更银行卡</button></td></tr><tr role="row" class="even"><td class=" hidden">6536048788262355969</td><td>晋商教育</td><td>广东明世在线教育科技有限公司</td><td>秦丽</td><td>411503199611014220</td><td>2019-05-20 09:24:25</td><td>2019-05-20 09:51:06</td><td>2019-05-20</td><td>9300</td><td>12</td><td>商户贴息</td><td>0</td><td>775</td><td>9300</td><td>8639.7</td><td>已放款</td><td><button type="button" data-id="6536048788262355969" class="btn btn-primary btn-sm mt_3" style="margin-bottom: 5px;padding:5px 16px;" name="public-deduct">提前结清</button><button type="button" data-id="6536048788262355969" data-source="17" data-cust-id="6535704275373215745" data-cust-name="秦丽" class="btn btn-primary btn-sm mt_3" name="modify_card">变更银行卡</button></td></tr><tr role="row" class="odd"><td class=" hidden">6536084463659516929</td><td>晋商教育</td><td>广东明世在线教育科技有限公司</td><td>柳肖肖</td><td>622726199602200668</td><td>2019-05-20 11:46:10</td><td>2019-05-20 11:57:25</td><td>2019-05-20</td><td>6735</td><td>12</td><td>商户贴息</td><td>0</td><td>561.25</td><td>6735</td><td>6256.81</td><td>已放款</td><td><button type="button" data-id="6536084463659516929" class="btn btn-primary btn-sm mt_3" style="margin-bottom: 5px;padding:5px 16px;" name="public-deduct">提前结清</button><button type="button" data-id="6536084463659516929" data-source="17" data-cust-id="6535877353544374273" data-cust-name="柳肖肖" class="btn btn-primary btn-sm mt_3" name="modify_card">变更银行卡</button></td></tr><tr role="row" class="even"><td class=" hidden">6535806014877336577</td><td>晋商教育</td><td>武汉远航智慧数码科技有限公司</td><td>王睿</td><td>420116199906024515</td><td>2019-05-20 10:57:01</td><td>2019-05-20 11:03:04</td><td>2019-05-20</td><td>16800</td><td>18</td><td>客户付息</td><td>6</td><td>1101.33</td><td>16800</td><td>16800</td><td>已放款</td><td><button type="button" data-id="6535806014877336577" class="btn btn-primary btn-sm mt_3" style="margin-bottom: 5px;padding:5px 16px;" name="public-deduct">提前结清</button><button type="button" data-id="6535806014877336577" data-source="17" data-cust-id="6535795743811721217" data-cust-name="王睿" class="btn btn-primary btn-sm mt_3" name="modify_card">变更银行卡</button></td></tr><tr role="row" class="odd"><td class=" hidden">6536047057279386625</td><td>晋商教育</td><td>深圳市宝安区卓文教育培训中心</td><td>苏志鹏</td><td>431121199712221012</td><td>2019-05-20 09:17:32</td><td>2019-05-20 09:28:36</td><td>2019-05-20</td><td>14800</td><td>18</td><td>客户付息</td><td>6</td><td>970.22</td><td>14800</td><td>14800</td><td>已放款</td><td><button type="button" data-id="6536047057279386625" class="btn btn-primary btn-sm mt_3" style="margin-bottom: 5px;padding:5px 16px;" name="public-deduct">提前结清</button><button type="button" data-id="6536047057279386625" data-source="17" data-cust-id="6536042715231586305" data-cust-name="苏志鹏" class="btn btn-primary btn-sm mt_3" name="modify_card">变更银行卡</button></td></tr><tr role="row" class="even"><td class=" hidden">6536066070680175617</td><td>晋商教育</td><td>深圳市宝安区卓文教育培训中心</td><td>袁世贵</td><td>469002199710044911</td><td>2019-05-20 10:33:05</td><td>2019-05-20 10:39:40</td><td>2019-05-20</td><td>14800</td><td>18</td><td>客户付息</td><td>6</td><td>970.22</td><td>14800</td><td>14800</td><td>已放款</td><td><button type="button" data-id="6536066070680175617" class="btn btn-primary btn-sm mt_3" style="margin-bottom: 5px;padding:5px 16px;" name="public-deduct">提前结清</button><button type="button" data-id="6536066070680175617" data-source="17" data-cust-id="6535377317732268033" data-cust-name="袁世贵" class="btn btn-primary btn-sm mt_3" name="modify_card">变更银行卡</button></td></tr><tr role="row" class="odd"><td class=" hidden">6536108849833706497</td><td>晋商教育</td><td>深圳市宝安区卓文教育培训中心</td><td>颜臻玲</td><td>50022719950916392X</td><td>2019-05-20 13:23:04</td><td>2019-05-20 13:35:51</td><td>2019-05-20</td><td>14800</td><td>18</td><td>客户付息</td><td>6</td><td>970.22</td><td>14800</td><td>14800</td><td>已放款</td><td><button type="button" data-id="6536108849833706497" class="btn btn-primary btn-sm mt_3" style="margin-bottom: 5px;padding:5px 16px;" name="public-deduct">提前结清</button><button type="button" data-id="6536108849833706497" data-source="17" data-cust-id="6536071272872159233" data-cust-name="颜臻玲" class="btn btn-primary btn-sm mt_3" name="modify_card">变更银行卡</button></td></tr><tr role="row" class="even"><td class=" hidden">6536071557894112257</td><td>晋商教育</td><td>上海海同优才教育培训有限责任公司</td><td>肖艳旭</td><td>412822199010014205</td><td>2019-05-20 10:54:53</td><td>2019-05-20 11:00:08</td><td>2019-05-20</td><td>16800</td><td>24</td><td>客户付息</td><td>6</td><td>868</td><td>16800</td><td>16800</td><td>已放款</td><td><button type="button" data-id="6536071557894112257" class="btn btn-primary btn-sm mt_3" style="margin-bottom: 5px;padding:5px 16px;" name="public-deduct">提前结清</button><button type="button" data-id="6536071557894112257" data-source="17" data-cust-id="6536064575738823681" data-cust-name="肖艳旭" class="btn btn-primary btn-sm mt_3" name="modify_card">变更银行卡</button></td></tr><tr role="row" class="odd"><td class=" hidden">6536084611329426433</td><td>晋商教育</td><td>上海育创网络科技股份有限公司</td><td>陈立鹏</td><td>320831199907312613</td><td>2019-05-20 11:46:45</td><td>2019-05-20 11:52:07</td><td>2019-05-20</td><td>19980</td><td>24</td><td>客户付息</td><td>6</td><td>1032.3</td><td>19980</td><td>19980</td><td>已放款</td><td><button type="button" data-id="6536084611329426433" class="btn btn-primary btn-sm mt_3" style="margin-bottom: 5px;padding:5px 16px;" name="public-deduct">提前结清</button><button type="button" data-id="6536084611329426433" data-source="17" data-cust-id="6536078376271883265" data-cust-name="陈立鹏" class="btn btn-primary btn-sm mt_3" name="modify_card">变更银行卡</button></td></tr><tr role="row" class="even"><td class=" hidden">6536090369644299265</td><td>晋商教育</td><td>武汉远航智慧数码科技有限公司</td><td>赵子康</td><td>421023200005214914</td><td>2019-05-20 12:09:38</td><td>2019-05-20 12:35:38</td><td>2019-05-20</td><td>16800</td><td>24</td><td>客户付息</td><td>6</td><td>868</td><td>16800</td><td>16800</td><td>已放款</td><td><button type="button" data-id="6536090369644299265" class="btn btn-primary btn-sm mt_3" style="margin-bottom: 5px;padding:5px 16px;" name="public-deduct">提前结清</button><button type="button" data-id="6536090369644299265" data-source="17" data-cust-id="6536084344928620545" data-cust-name="赵子康" class="btn btn-primary btn-sm mt_3" name="modify_card">变更银行卡</button></td></tr></tbody></table><div class="bottom"><div class="dataTables_info" id="lendingList_info" role="status" aria-live="polite">显示第 1 - 10 条记录，共12 条</div><div class="dataTables_length" id="lendingList_length"><label> <select name="lendingList_length" aria-controls="lendingList" class="form-control input-sm"><option value="10">10</option><option value="25">25</option><option value="50">50</option><option value="100">100</option></select> </label></div><div class="dataTables_paginate paging_full_numbers" id="lendingList_paginate"><ul class="pagination"><li class="paginate_button first disabled" id="lendingList_first"><a href="javascript:void(0);" aria-controls="lendingList" data-dt-idx="0" tabindex="0">首页</a></li><li class="paginate_button previous disabled" id="lendingList_previous"><a href="javascript:void(0);" aria-controls="lendingList" data-dt-idx="1" tabindex="0">上页</a></li><li class="paginate_button active"><a href="javascript:void(0);" aria-controls="lendingList" data-dt-idx="2" tabindex="0">1</a></li><li class="paginate_button "><a href="javascript:void(0);" aria-controls="lendingList" data-dt-idx="3" tabindex="0">2</a></li><li class="paginate_button next" id="lendingList_next"><a href="javascript:void(0);" aria-controls="lendingList" data-dt-idx="4" tabindex="0">下页</a></li><li class="paginate_button last" id="lendingList_last"><a href="javascript:void(0);" aria-controls="lendingList" data-dt-idx="5" tabindex="0">末页</a></li></ul></div><div class="clear"></div></div></div>
            </div>
            <!--正文内容end-->
        </div>
        
        
		    
		        
		            
		                
		                
		            
		            
		            	
			                
			                    
				                    
				                    	
				                    	
				                        
				                        
				                        
				                        
				                        
				                        
				                    
			                    
			                
			            
		            
		            
		                
		            
		        
		    
		
<script src="jedate/jedate.min.js"></script>

<script>
    jeDate({
        dateCell:"#applyDateStart1", //目标元素。由于jedate.js封装了一个轻量级的选择器，因此dateCell还允许你传入class、tag这种方式 '#id .class'
        format:"YYYY-MM-DD", //日期格式
        minDate:"1900-01-01", //最小日期
        maxDate:"2099-12-31", //最大日期
        isinitVal:false, //是否初始化时间
        isTime:true, //是否开启时间选择
        isClear:true, //是否显示清空
        festival:false, //是否显示节日
        zIndex:999,  //弹出层的层级高度
        marks:null, //给日期做标注
        choosefun:function(val) {},  //选中日期后的回调
        clearfun:function(val) {},   //清除日期后的回调
        okfun:function(val) {}       //点击确定后的回调
    });
    jeDate({
        dateCell:"#applyDateStart2", //目标元素。由于jedate.js封装了一个轻量级的选择器，因此dateCell还允许你传入class、tag这种方式 '#id .class'
        format:"YYYY-MM-DD", //日期格式
        minDate:"1900-01-01", //最小日期
        maxDate:"2099-12-31", //最大日期
        isinitVal:false, //是否初始化时间
        isTime:true, //是否开启时间选择
        isClear:true, //是否显示清空
        festival:false, //是否显示节日
        zIndex:999,  //弹出层的层级高度
        marks:null, //给日期做标注
        choosefun:function(val) {},  //选中日期后的回调
        clearfun:function(val) {},   //清除日期后的回调
        okfun:function(val) {}       //点击确定后的回调
    });
    jeDate({
        dateCell:"#applyDateStart3", //目标元素。由于jedate.js封装了一个轻量级的选择器，因此dateCell还允许你传入class、tag这种方式 '#id .class'
        format:"YYYY-MM-DD hh:mm:ss", //日期格式
        minDate:"1900-01-01 00:00:00", //最小日期
        maxDate:"2099-12-31 23:59:59", //最大日期
        isinitVal:false, //是否初始化时间
        isTime:true, //是否开启时间选择
        isClear:true, //是否显示清空
        festival:false, //是否显示节日
        zIndex:999,  //弹出层的层级高度
        marks:null, //给日期做标注
        choosefun:function(val) {},  //选中日期后的回调
        clearfun:function(val) {},   //清除日期后的回调
        okfun:function(val) {}       //点击确定后的回调
    });
    jeDate({
        dateCell:"#applyDateStart4", //目标元素。由于jedate.js封装了一个轻量级的选择器，因此dateCell还允许你传入class、tag这种方式 '#id .class'
        format:"YYYY-MM-DD hh:mm:ss", //日期格式
        minDate:"1900-01-01 00:00:00", //最小日期
        maxDate:"2099-12-31 23:59:59", //最大日期
        isinitVal:false, //是否初始化时间
        isTime:true, //是否开启时间选择
        isClear:true, //是否显示清空
        festival:false, //是否显示节日
        zIndex:999,  //弹出层的层级高度
        marks:null, //给日期做标注
        choosefun:function(val) {},  //选中日期后的回调
        clearfun:function(val) {},   //清除日期后的回调
        okfun:function(val) {}       //点击确定后的回调
    });
</script>

<script>
    var dt;
    function refresh(){
        dt.api(dt.api().page()).draw(false);
    }
     $(function(){
         $("body").delegate('#repaymentCardNo',"keyup",function(){
             this.value =this.value.replace(/\s/g,'').replace(/(\d{4})(?=\d)/g,"$1 ");
         });


    	dt = $("#lendingList").dataTable({
	         "sDom":'<"top"<"clear">>rt<"bottom"ilp<"clear">>', 
	         bProcessing:true,
	         pageLength: 10,
	         searching: false, // 禁用dataTables自带的查询框
	         ordering: false, // 禁用排序
	         ajax: {
	             type: "POST",
	             url: "/hd/lending/getAlreadyLendingListData",
	             data:function(d) {
	           	  d.idNo = $("#idNo").val();
	           	  d.idName = $("#idName").val();
	           	  //d.lendingDate = $("#applyDateStart2").val();
	           	  d.bcName = $("#bcName").val();
	           	  d.fundSource=$("#fundSource").val();
	           	  d.lendingDateStart = $("#applyDateStart1").val();
                  d.lendingDateEnd = $("#applyDateStart2").val();
	           	  d.examineDateStart = $("#applyDateStart3").val();
	           	  d.examineDateEnd = $("#applyDateStart4").val();
                     var checkBox = $("input[name='rebateType']:checked");
                     var checkBoxValue = "";
                     checkBox.each(function(){
                         checkBoxValue += $(this).val()+",";
                     })

                     checkBoxValue = checkBoxValue.substring(0,checkBoxValue.length-1);
	           	  d.applyStatus = checkBoxValue;

	             }
	         },
	         columns: [
	             {data:"applyId","sTitle":"1","sClass":"hidden"},
                 {data:"capitalName" },
                 {data:"bcName" },
                 {data: "idName"},
                 {data: "idNo"},
	             {data:"importTime"},
	             {data:"examineDate"},
	             {data:"lendingDate"},
	             {data:"applyAmount"},
	             {data:"applyDuration"},
                 {data: "rateType"},
                 {data: "gracePeriod"},
	             {data:"periodAmount"},
	             {data: "loanAmount"},
	             {data: "hdLoanAmount"},
	             {data: "status",render:function(data,type,row){
	               if(7000==data){
	                    return "已放款";
                     }else if(9000==data){
                        return "订单完结";
	                    }else if(8000==data){
                             return "提前还款";
                         }else if(9500==data){
                             return "退货";
                         }else{
	                   return data;
                   }
                     }},
                 {data: "applyId",render:function(data,type,row){
                     var flag = row.fundSource==="16"

                     if(row.status==7000 && row.fundSource!=='14' && row.fundSource!=='16'){
                         var operation = "<button type='button'  data-id="+data+" class='btn btn-primary btn-sm mt_3' style='margin-bottom: 5px;padding:5px 16px;' name='public-deduct'>提前结清</button>"+
                                 "<button type='button' data-id="+data+" data-source="+row.fundSource+" data-cust-id="+row.hdCustInfoId+" data-cust-name="+row.idName+" class='btn btn-primary btn-sm mt_3' name='modify_card'>变更银行卡</button>";
                         return operation;
                     }
                     return '';
                 }}
	         ]

	     });
    	 $("#btn-search").click(function(e){
             var capitalDateStart = $("#applyDateStart1").val();
             var capitalDateEnd = $("#applyDateStart2").val();
             var examineDateStart = $("#applyDateStart3").val();
          	 var examineDateEnd = $("#applyDateStart4").val();
             if(examineDateStart&&examineDateEnd){
                 if(examineDateStart >=examineDateEnd){
                     layer.msg("信审结束日期必须大于信审开始日期!");
                     return false;
                 }
             }
             if(capitalDateStart&&capitalDateEnd){
                 if(capitalDateStart > capitalDateEnd){
                     layer.msg("资方放款结束日期必须大于资方放款开始日期!");
                     return false;
                 }
             }
             dt.api().draw();
         });
         //给行绑定双击事件
         $('#lendingList tbody').on('dblclick', 'tr', function () {
             var item = dt.api().row(this).data();
             var applyId = item.applyId;
             var url = '/hd/lending/getRepayPlan/'+applyId;
             layer.open({
                 type: 2,
                 area: ['1280px', '600px'],
                 title: '贷款情况详情页面',
                 shadeClose: true, //点击遮罩关闭
                 content: url
             });
         });

         $("#lendingList").on("click","button[name='public-deduct']",function(e){
             var applyId = $(this).attr("data-id");
             $.ajax({
                 type: 'POST',
                 url: "/hd/deduct/getBackDiscountAmount" ,
                 data:{applyId:applyId} ,
                 async: true,
                 success:function(data){
                     if('200'==data.code){
                         var bizSetlAmt1=0;
                         var disCountAmount1=0;
                         var hdSetlAmt1=0;
                         console.log(data);
                        if(null ==data.result){
                             bizSetlAmt1=0;
                             disCountAmount1=0;
                             hdSetlAmt1=0;
                            layer.msg(data.msg+" 或还款计划暂未生成");
                            return false;
                        }else {
                                bizSetlAmt1=data.result.bizSetlAmt;
                                disCountAmount1=data.result.disCountAmount;
                                hdSetlAmt1=data.result.hdSetlAmt;
                        }

                         var initButton="<p class='fixP mt_15'><span class='tx'>商户应退互动金额:</span><input class='borSty' type='number' id='bizSetlAmt' value='"+bizSetlAmt1+"'></p><input class='borSty' type='hidden' id='backDiscountAmount' value='"+disCountAmount1+"'>" +
                                 "<p class='fixP mt_15'><span class='tx'>互动应退资方金额:</span><input class='borSty' type='number' id='hdSetlAmt' value='"+hdSetlAmt1+"'></p>";
                         layer.open({
                             type: 1,
                             area: ['300px', '200px'],
                             title: '提前还款',
                             btn: ['确定','取消'],
                             yes: function (index, layero) {
                                 var backBizDiscountAmount=Number($("#backDiscountAmount").val());
                                 var hdSetlAmt=Number($("#hdSetlAmt").val());
                                 var bizSetlAmt=Number($("#bizSetlAmt").val());

                                 $.ajax({
                                     type: 'POST',
                                     url: "/hd/deduct/prepayment" ,
                                     data:{applyId:applyId,backBizDiscountAmount:backBizDiscountAmount,hdSetlAmt:hdSetlAmt,bizSetlAmt:bizSetlAmt} ,
                                     async: true,
                                     success:function(data){
                                         if('200'==data.code){
                                             layer.msg("提前还款成功");
                                             refresh();
                                         }else{
                                             layer.msg(data.msg+"提前还款失败");
                                         }
                                     }
                                 });
                                 layer.close(index);
                             },
                             cancel:function(index){
                                 //按钮【按钮二】的回调
                                 layer.close(index);
                             },
                             shadeClose: true, //点击遮罩关闭
                             content:initButton
                         });
                     }else{
                         layer.msg(data.msg+"对公扣款失败");
                     }
                 }
             });

         });

         $("#lendingList").on("click","button[name='modify_card']",function(e){
             var applyId = $(this).attr("data-id");
             var fundSource=$(this).attr("data-source");
             var hdCustInfoId=$(this).attr("data-cust-id");
             var idName=$(this).attr("data-cust-name");

             $.ajax({
                 type: 'POST',
                 url: "/hd/deduct/getModifyCardMsg" ,
                 data:{applyId:applyId,fundSource:fundSource} ,
                 async: true,
                 success:function(data){
                     if('200'==data.code){
                         var bankMsg=data.result;
                         var banks=bankMsg.data;
                         var selectStr="<select id='cardName' class='cardSelect'>"
                         for(var i=0;i<banks.length;i++){
                             selectStr+="<option value='"+banks[i].value+"'";
                             if(banks[i].value == bankMsg.repaymentBank){
                                 selectStr+=" selected "
                             }
                             selectStr+=">"+banks[i].name+"</option>"
                         }
                         bankMsg.repaymentCardNo=bankMsg.repaymentCardNo.replace(/\s/g,'').replace(/(\d{4})(?=\d)/g,"$1 ");
                         selectStr+="</select>"
                         var initButton="<p class='fixP mt_15'><span class='tx'>还款开户行:</span>"+selectStr+"</p>" +
                                 "<p class='fixP mt_15'><span class='tx' style='padding-right: 13px;'>还款卡号:</span><input  class='borSty' style='width:150px;font-size: 12px;'  id='repaymentCardNo' value='"+bankMsg.repaymentCardNo+"'></p>"+
                                 "<p class='fixP mt_15'><span class='tx' '>绑定手机号:</span><input  class='borSty' style='width:150px;font-size: 12px;'  id='cardPhoneNo' value='"+bankMsg.repaymentCardPhoneNo+"'></p>"+
                                 "<p class='fixP mt_15'><span class='tx'>是否对银行卡进行四要素校验:</span><input  type='checkbox' id='cardValid' ></p>";
                         layer.open({
                             type: 1,
                             area: ['300px', '270px'],
                             title: '变更银行卡',
                             btn: ['确定','取消'],
                             yes: function (index, layero) {
                                 var repaymentCardNo=$("#repaymentCardNo").val();
                                 var cardName=$("#cardName").val();
                                 var phoneNo=$("#cardPhoneNo").val();
                                 var checked=$("input[type='checkbox']").is(':checked');
                                 repaymentCardNo = repaymentCardNo.replace(/\s+/g,"");
                                 var reg = /^(\d{16}|\d{19})$/;


                                 if(!repaymentCardNo.match(reg)){
                                     layer.msg("银行卡格式不正确");
                                     return;
                                 }
                                 if(!phoneNo.trim()){
                                     layer.msg("手机号不能为空!");
                                     return ;
                                 }
                                 if(!(/^1[3|4|5|7|8]\d{9}$/.test(phoneNo))){
                                     layer.msg("手机号码有误，请重填");
                                     return ;
                                 }
                                 var oldCardNo=bankMsg.repaymentCardNo.replace(/\s+/g,"");
                                 if(repaymentCardNo==oldCardNo&&cardName==bankMsg.repaymentBank&&phoneNo==bankMsg.repaymentCardPhoneNo){
                                     layer.msg("没有对银行卡信息做任何修改");
                                     return;
                                 }

                                 $(layero).find(".layui-layer-btn0").attr("disabled",true);
                                 if(checked){
                                     var mobileModify=false;
                                     var bindUrl="/hd/loan/juheBindBankCard";

                                     $.ajax({
                                         type: 'POST',
                                         url: bindUrl ,
                                         data: {applyDetailId:bankMsg.applyDetailId,name:bankMsg.repaymentCustName,idNo:bankMsg.idNo,cardNo:repaymentCardNo,mobile:phoneNo,mobileModify:true,hdCustInfoId:bankMsg.hdCustInfoId,bank:cardName},
                                         success:function(data){
                                             if(200==data.code){
                                                 if("1"==data.result.res){
                                                     modifyOrderCardMsg(bankMsg.applyId,bankMsg.applyDetailId,cardName,repaymentCardNo,hdCustInfoId,idName,phoneNo,true);
                                                     layer.close(index);
                                                 }else{
                                                     layer.msg(data.result.message);
                                                     $(layero).find(".layui-layer-btn0").attr("disabled"," ");
                                                 }
                                             }else{
                                                 layer.msg(data.msg);
                                                 $(layero).find(".layui-layer-btn0").attr("disabled"," ");
                                             }
                                         }
                                     });
                                 }else{
                                     modifyOrderCardMsg(bankMsg.applyId,bankMsg.applyDetailId,cardName,repaymentCardNo,hdCustInfoId,idName,phoneNo,false);
                                     layer.close(index);
                                 }

                             },
                             cancel:function(index){
                                 //按钮【按钮二】的回调
                                 layer.close(index);
                             },
                             shadeClose: true, //点击遮罩关闭
                             content:initButton
                         });
                     }else{
                         layer.msg(data.msg+"加载卡信息失败");
                     }
                 }
             });
         });


    });

    function modifyOrderCardMsg(applyId,applyDetailId,repaymentBank,repaymentCardNo,hdCustInfoId,idName,phoneNo,cardValid) {
        $.ajax({
            type: 'POST',
            url: "/hd/deduct/modifyOrderCardMsg" ,
            data:{applyId:applyId,applyDetailId:applyDetailId,repaymentBank:repaymentBank,repaymentCardNo:repaymentCardNo,hdCustInfoId:hdCustInfoId,custName:idName,phoneNo:phoneNo,cardValid:cardValid} ,
            async: true,
            success:function(data){
                if('200'==data.code){
                    layer.msg("银行卡变更成功");
                }else{
                    layer.msg(data.msg+"银行卡变更失败");
                }
            }
        });
    }
    
    function exportResult(){
        layer.confirm("确定要导出结果到excel中吗？", {
            btn: ['确认','取消'], //按钮
            yes:function (index, layero) {
                var idNo = $("#idNo").val();
                if(idNo === undefined){
                	idNo = '';
                }
                var idName = $("#idName").val();
                if(idName === undefined){
                	idName = '';
                }
                var bcName = $("#bcName").val();
                if(bcName === undefined){
                	bcName = '';
                }
                var lendingDateStart = $("#applyDateStart1").val();
                if(lendingDateStart === undefined){
                    lendingDateStart = '';
                }
                var lendingDateEnd = $("#applyDateStart2").val();
                if(lendingDateEnd === undefined){
                    lendingDateEnd = '';
                }
                var examineDateStart = $("#examineDateStart").val();
                if(examineDateStart === undefined){
                	examineDateStart = '';
                }
                var examineDateEnd = $("#examineDateEnd").val();
                if(examineDateEnd === undefined){
                	examineDateEnd = '';
                }
                var fundSource = $("#fundSource").val();
                if(fundSource === undefined){
                	fundSource = '';
                }
                var checkBox = $("input[name='rebateType']:checked");
                var checkBoxValue = "";
                checkBox.each(function(){
                    checkBoxValue += $(this).val()+",";
                })

                checkBoxValue = checkBoxValue.substring(0,checkBoxValue.length-1);
                var url="/hd/lending/alreadyLendingExport/?idNo="+idNo+"&idName="+idName+"&bcName="+bcName+"&lendingDateStart="+lendingDateStart+"&lendingDateEnd="+lendingDateEnd
                		+ "&examineDateStart=" + examineDateStart + "&examineDateEnd=" + examineDateEnd + "&fundSource=" + fundSource+ "&status=" + checkBoxValue;
                window.open(url);
                layer.close(index);
            },
            cancel:function(index){
                //按钮【按钮二】的回调
                layer.close(index);
            },
        });
    }
</script>


<script>
    //分页方法
    function page(n,s){
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#searchForm").submit();
        return false;
    }


</script>

<script>
    var time = 100000;
    var interval; //调度器对象。
    function run(){
        interval = setInterval("fun()",time);
    }
    function fun(){
        $(".hui").css("display","none");
    }
    $(function(){
        $("#reviewList").delegate('tr td button','click',function(){
            $(this).html("加载中...").attr("disabled","disabled");
            $(".hui").css("display","block");
            run();
        })
    })
</script>

<script>
    $(document).ready(function(e) {
        var counter = 0;
        if (window.history && window.history.pushState) {
            $(window).on('popstate', function () {
                window.history.pushState('forward', null, '#');
                window.history.forward(1);
            });
        }
        window.history.pushState('forward', null, '#'); //在IE中必须得有这两行
        window.history.forward(1);
    });
</script>

</div>